package com.lagou.service;

import com.lagou.pojo.Article;
import com.lagou.repository.ArticleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ArticleService {
    @Autowired
    private ArticleRepository articleRepository;

    public List<Article> findAll(){
        List<Article> all = articleRepository.findAll();
        return all;
    }

    public int getArticleCount(){
        return articleRepository.queryCount();
    }

    public List<Article> pageList(Map map){
        return articleRepository.queryPageList((Integer) map.get("pageNo"),(Integer)map.get("pageSize"));
    }



}
